package com.m7.imkfsdk.chat.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.m7.imkfsdk.R;

public class PermissionDescriptionDialog extends Dialog {

    private TextView mTitleView, mContentView;

    public PermissionDescriptionDialog(@NonNull Context context) {
        super(context, R.style.ykfsdk_dialog_t);
        setContentView(R.layout.ykfsdk_kf_dialog_permission);
        setCanceledOnTouchOutside(false);
        setCancelable(false);

        initView();

        Window window = getWindow();
        if (window != null) {
            window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.WRAP_CONTENT);
            window.setGravity(Gravity.TOP);
        }
    }

    private void initView() {
        mTitleView = findViewById(R.id.tv_title);
        mContentView = findViewById(R.id.tv_content);
    }

    public PermissionDescriptionDialog setTitleValue(String title) {
        mTitleView.setText(title);
        return this;
    }

    public PermissionDescriptionDialog setContentValue(String title) {
        mContentView.setText(title);
        return this;
    }
}
